<div id="form_container" style="border:none; width:800px; margin: 10px 78px 0px 78px;">
	<div id="form_text" style="margin:0px;" class="settings">
    	<h2>General Settings</h2>
    </div>
	<?php
    if($form->num_errors > 0){
		echo " <div id=\"form_error\" style=\"width:790px;\">
			<span style='color:#F00'>".$form->num_errors." error(s) found</span>
		</div>";
    }
    if(isset($_SESSION['configedit'])){
		unset($_SESSION['configedit']);
			echo "<div id=\"form_error\" style=\"color:#0C0; border-color:#0C0; width:790px\">Details Updated!</div>";
    }
    ?>
	<div id="form_content" class="settings">
        <form action="adminprocess.php" method="POST">
        <!-- The settings of the site back-end information -->
        <fieldset><legend>Site Settings</legend>
        <ul>
            <li id="li_sitename">
                <label id="label_user" for="sitename">Site Name<span class="description_label"><?php echo $form->error("sitename"); ?></span></label>
                <input id="sitename" type="text" name="sitename" maxlength="255" value="<?php echo $config['SITE_NAME']; ?>" />
                <span id="sitenameInfo" class="desc">The Name Of The Website</span>
            </li>
            <li id="li_sitedesc">
                <label id="label_sitedesc" for="sitedesc">Site Description<span class="description_label"><?php echo $form->error("sitedesc"); ?></span></label>
                <input id="sitedesc" type="text" name="sitedesc" maxlength="255" value="<?php echo $config['SITE_DESC']; ?>" />
                <span id="sitedescInfo">The Site Description</span>
            </li>
           <li id="li_emailfromname">
                <label id="label_emailfromname" for="emailfromname">Email From Name<span class="description_label"><?php echo $form->error("emailfromname"); ?></span></label>
                <input id="emailfromname" type="text" name="emailfromname" maxlength="255" value="<?php echo $config['EMAIL_FROM_NAME']; ?>" />
                <span id="emailfromnameInfo">The "From" Field Of Any Outgoing Emails</span>
            </li>
            <li id="li_adminemail">
                <label id="label_adminemail" for="adminemail">Site/Admin Email Address<span class="description_label"><?php echo $form->error("adminemail"); ?></span></label>
                <input id="adminemail" type="text" name="adminemail" maxlength="255" value="<?php echo $config['EMAIL_FROM_ADDR']; ?>" />
                <span id="adminemailInfo">The Outgoing Email Address</span>
            </li><li id="li_webroot">
                <label id="label_webroot" for="webroot">Site Root<span class="description_label"><?php echo $form->error("webroot"); ?></span></label>
                <input id="webroot" type="text" name="webroot" maxlength="255" value="<?php echo $config['WEB_ROOT']; ?>" />
                <span id="webrootInfo">Full URL & Sub Folder eg, http://www.mysite.com/login/</span>
            </li>
            </li><li id="li_home_page">
                <label id="label_home_page" for="home_page">Home Page<span class="description_label"><?php echo $form->error("home_page"); ?></span></label>
                <input id="home_page" type="text" name="home_page" maxlength="255" value="<?php echo $config['WEB_ROOT']; ?>" />
                <span id="home_pageInfo">Eg, index.php - The page users are redirected to after logging off</span>
            </li>
        </ul>
        </fieldset>
        
        <!-- The settings of the registration page -->
        <fieldset><legend>Registration Settings</legend>
            </li><li id="li_activation">
                <label id="label_activation" for="accountactivation">Account Activation<span class="description_label"></span></label>
                    <label class="radio"><input name="activation" value="4" class="radio" type="radio" <?php if($config['ACCOUNT_ACTIVATION'] == 4) { echo "checked='checked'"; } ?>><span class="description">Disable Registration (No One Can Register)</span></label>
                    <label class="radio"><input name="activation" value="1" class="radio" type="radio" <?php if($config['ACCOUNT_ACTIVATION'] == 1) { echo "checked='checked'"; } ?>><span class="description">No Activation (Immeadiate Access)</span></label>
                    <label class="radio"><input name="activation" value="2" class="radio" type="radio" <?php if($config['ACCOUNT_ACTIVATION'] == 2) { echo "checked='checked'"; } ?>><span class="description">By User (Send An Email Activation To User -- "Broad-wide Email" Must Be Enabled)</span></label>
                    <label class="radio"><input name="activation" value="3" class="radio" type="radio" <?php if($config['ACCOUNT_ACTIVATION'] == 3) { echo "checked='checked'"; } ?>><span class="description">By Admin (Admin Will Activate User Manually -- "Broad-wide Email" Must Be Enabled)</span></label>
            </li>
            <li id="li_min_name_chars">
                <label id="label_min_name_chars" for="min_name_chars">Username length<span class="description_label"><?php echo $form->error("min_user_chars"); ?><?php echo $form->error("max_user_chars"); ?></span></label>
                    <span class="description" style="margin:0px 5px 0px 5px; font-size:14px; color:#666; padding:0px;">Min </span>
                    <input style="width:30px;" id="min_name_chars" type="text" name="min_name_chars" maxlength="5" value="<?php echo $config['min_user_chars']; ?>" />   
                    <span class="description" style="margin:0px 5px 0px 5px; font-size:14px; color:#666; padding:0px;">Max </span>
                    <input id="num" style="width:30px; " type="text" size="3" maxlength="5" name="max_user_chars" value="<?php echo $config['max_user_chars']; ?>" />
                <span id="min_name_charsInfo">Minimum and maximum number of characters in usernames</span></p>
            </li>
            <li id="li_min_pass_chars">
                <label id="label_min_pass_chars" for="min_pass_chars">Password length<span class="description_label"><?php echo $form->error("min_pass_chars"); ?><?php echo $form->error("max_pass_chars"); ?></span></label>
                    <span class="description" style="margin:0px 5px 0px 5px; font-size:14px; color:#666; padding:0px;">Min </span>
                    <input style="width:30px;" id="min_pass_chars" type="text" name="min_pass_chars" maxlength="3" value="<?php echo $config['min_pass_chars']; ?>" />   
                    <span class="description" style="margin:0px 5px 0px 5px; font-size:14px; color:#666; padding:0px;">Max </span>
                    <input id="num" style="width:30px;" type="text" size="3" maxlength="3" name="max_pass_chars" value="<?php echo $config['max_pass_chars']; ?>" />
                <span id="min_pass_charsInfo">Minimum and maximum number of characters in passwords</span></p>
            </li>
            <li id="li_send_welcome">
                <label id="label_send_welcome">Send Welcome E-mail<span class="description_label"></span></label>
                    <span class="description" style="margin:0px -15px 0px 5px; font-size:14px; color:#666; padding:0px;">Yes</span>
                    <input name="send_welcome" value="1" class="radio" type="radio" <?php if($config['EMAIL_WELCOME'] == 1) { echo "checked='checked'"; } ?>>
                    <span class="description" style="margin:0px -15px 0px 5px; font-size:14px; color:#666; padding:0px;">No</span>
                    <input name="send_welcome" value="0" class="radio" type="radio" <?php if($config['EMAIL_WELCOME'] == 0) { echo "checked='checked'"; } ?>>
                <span id="home_pageInfo">Whether or not to send a welcome e-mail to newly registered users</span>
            </li>
            <li id="li_enable_capthca">
                <label id="label_enable_capthca">Enable Captcha<span class="description_label"></span></label>
                    <span class="description" style="margin:0px -15px 0px 5px; font-size:14px; color:#666; padding:0px;">Yes</span>
                    <input name="enable_capthca" value="1" class="radio" type="radio" <?php if($config['ENABLE_CAPTCHA'] == 1) { echo "checked='checked'"; } ?>>
                    <span class="description" style="margin:0px -15px 0px 5px; font-size:14px; color:#666; padding:0px;">No</span>
                    <input name="enable_capthca" value="0" class="radio" type="radio" <?php if($config['ENABLE_CAPTCHA'] == 0) { echo "checked='checked'"; } ?>>
                <span id="home_pageInfo">Enables or disables captcha system at registration</span>
            </li>
            <li id="li_all_lowercase">
                <label id="label_all_lowercase">Username Lowercase<span class="description_label"></span></label>
                    <span class="description" style="margin:0px -15px 0px 5px; font-size:14px; color:#666; padding:0px;">Yes</span>
                    <input name="all_lowercase" value="1" class="radio" type="radio" <?php if($config['ALL_LOWERCASE'] == 1) { echo "checked='checked'"; } ?>>
                    <span class="description" style="margin:0px -15px 0px 5px; font-size:14px; color:#666; padding:0px;">No</span>
                    <input name="all_lowercase" value="0" class="radio" type="radio" <?php if($config['ALL_LOWERCASE'] == 0) { echo "checked='checked'"; } ?>>
                <span id="home_pageInfo">Makes submitted username all lowercase</span>
            </li>        
        </fieldset>
        
        <!-- Settings for session -->
        <fieldset><legend>Session Settings</legend>
            </li><li id="li_cookie_expiry">
                <label id="label_cookie_expiry" for="cookie_expiry">Cookie Expiry<span class="description_label"><?php echo $form->error("cookie_expiry"); ?></span></label>
                <input id="cookie_expiry" type="text" name="cookie_expiry" maxlength="10" value="<?php echo $config['COOKIE_EXPIRE']; ?>" />
                <span id="home_pageInfo">Amount of time for cookie to remains active on a visitor's machine in days</span>
            </li>
            </li><li id="li_cookie_path">
                <label id="label_cookie_path" for="cookie_path">Cookie Expiry<span class="description_label"><?php echo $form->error("cookie_path"); ?></span></label>
                <input id="cookie_path" type="text" name="cookie_path" maxlength="10" value="<?php echo $config['COOKIE_PATH']; ?>" />
                <span id="home_pageInfo">Use '/' to include the whole domain. Best to leave it as is if not sure</span>
            </li>
        </fieldset>
        <input class="submit" type="submit" id="submit" name="submit" value="Submit" />&nbsp;
        <input class="submit" type="reset" id="reset" name="reset" value="Reset" />
        <input type="hidden" name="configedit" value="1">
        </form>
	</div>
</div>